<%
    String files[]={"IMAG0090.jpg","2009_0712_092616.JPG"};
    String id=request.getParameter("id");
    String filename= "D:/java/IMAG0090.jpg";
    if(id!=null)
	filename="D:/java/"+files[Integer.parseInt(id)];
    
    System.out.println(application.getMimeType(filename));
    response.setContentType(application.getMimeType(filename));
    java.io.OutputStream os = response.getOutputStream();
    java.io.FileInputStream is = new java.io.FileInputStream(filename);

    int byteread = 0;
    while ((byteread = is.read()) != -1) {
	os.write(byteread);
    }
    is.close();
    os.flush();


%>